﻿@using GigaSite.Web.Classes
@using GigaSite.Web.Controllers
@using GigaSite.Web.Models

<!DOCTYPE html>
<html>

<head>
	<title>@ViewBag.Title</title>
	@Html.Partial("ScriptsAndCSSIncludes")
</head>

<body>
    <div id="main">
        <div id="notificationsHolder" align="center">
            
        </div>

        @*<div id="commonInfo" class="mt50px"></div>*@

        <div id="gigaBox">
	        <div class="menuWrapper">
		        <a href="@Url.Action("Index", "Home",new {area = ""})"><span id="giga"></span></a>
            <span id="search" style="position: relative">
                <input type="text" id="searchField" class="input-medium search-query span6" placeholder="Введите запрос...">
                <button id="searchButton" type="submit"></button>
            </span>
            <span id="addMartAd">
                <ul>
	                <li id="addMart">
		                @Html.ActionLink("создать компанию", "register", "company")
	                </li>
	                <li id="addAd">
		                @Html.ActionLink("добавить объявление","CreateAds","Ads",new {area = "Catalog"},null)
	                </li>
                </ul>
            </span>

		        <div class="clear"></div>
		        <div id="underSearchMenu">
			        <ul>
				        <li><a href="#">товары /</a></li>
				        <li><a href="#"> компании /</a></li>
				        <li><a href="#"> магазины /</a></li>
				        <li><a href="#"> сайты /</a></li>
				        <li><a href="#"> специалисты /</a></li>
				        <li><a href="#"> объявления /</a></li>
				        <li><a href="#"> развлечения</a></li>
			        </ul>
		        </div>
	        </div>
        </div>
    
        @if (Html.ViewContext.GetBaseController().IsAuthentificated)
        {
            <div id="personalUserMenu" class="menuWrapper">
	            <div class="menuWrapper">
		            <div id="expandUserInfoButton" class="toggleButton toggleButtonActive"
		                 title="Скрыть/показать персональную панель">

		            </div>
		            <div id="userSocialButton">
			            @Html.GetAccountProviderIcon(Html.ViewContext.GetBaseController().CurrentUser.IdentityProvider)
		            </div>
		            <div id="userNameBlock">
			            <div id="loginHolder">
				            @Html.ViewContext.GetBaseController().CurrentUser.GetDisplayName()
			            </div>
			            <div style="position: relative">
				            <div class="online">
					            online
				            </div>
			            </div>
		            </div>

		            <div id="userMenuItems">
			            <ul>
				            @Html.PersonalMenuItem("мои контакты","Messages","Account",count: 6)
				            @Html.PersonalMenuItem("мои друзья","Friends","Account",count: 2)
				            @Html.PersonalMenuSeparator()
				            @Html.PersonalMenuItem("мои компании","Shops","Account", count: 0)
				            @Html.PersonalMenuItem("мои объявления","My","Ads",count: 0, area: "Catalog")
				            @Html.PersonalMenuItem("настройки","Settings","Account",count: 0)
				            @Html.PersonalMenuItem("выход","LogOff","Account",count: 0)
			            </ul>
		            </div>
	            </div>
            </div>
            <div id="userInfoBlock">
                
            </div>
            @* Рабочий стол пользователя *@
            <div id="toolbarWrapper">
                <div class="menuWrapper">
                    <div id="userWorkbench">
                        @* Первый ряд *@
                        <div id="firstRow" class="workbenchRow">
                            <div class="toggleNextRowButton toggleButton" id="toggleSecondRowButton">

                            </div>
                            @* Основные элементы меню *@
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Id = "SitesNoteItem",
                                  Title = "Блокнот сайтов",
                                  ClickURL = Url.Action("Sites","Account"),
                                  Count = 2,
                                  ImageURL = Url.Content("~/Content/images/mySites.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Id = "MyGoodsItem",
                                  Title = "Мои товары",
                                  ClickURL = Url.Action("Goods","Account"),
                                  Count = 146,
                                  ImageURL = Url.Content("~/Content/images/myGoods.png"),
                                  UpdatesCount = 312
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Id = "MyCardsItem",
                                  Title = "Визитница",
                                  ClickURL = Url.Action("Cards","Account"),
                                  Count = 3245,
                                  ImageURL = Url.Content("~/Content/images/myCards.png"),
                                  UpdatesCount = 0
                              })
                            @* Временные элементы *@
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/1.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/2.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/3.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/4.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/5.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/6.png"),
                                  UpdatesCount = 0
                              })
                        </div>
                        @* Второй ряд *@
                        <div id="secondRow" class="workbenchRow">
                            <div class="toggleNextRowButton toggleButton" id="toggleThirdRowButton"></div>
                            @* Временные элементы *@
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/7.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/8.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/9.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/10.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/11.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/12.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/13.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/14.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/15.png"),
                                  UpdatesCount = 0
                              })
                            @Html.WorkbenchItem(new WorkbenchItemModel()
                              {
                                  Title = String.Empty,
                                  ClickURL = Url.Action("Index","Home"),
                                  Count = 0,
                                  ImageURL = Url.Content("~/Content/images/toolbar/16.png"),
                                  UpdatesCount = 0
                              })
                        </div>
                        @* Третий ряд *@
                        <div id="thirdRow" class="workbenchRow">
	                    
                        </div>
                    </div>
                    @* Блокнот сайтов *@
                    <div id="sitesNote">
                        @foreach(var site in Html.GetUserSites())
                        {
                            @Html.Partial("SiteNote",site)
                        }
                    </div>
                </div>
            </div>
        }
        else
        {
	        <div id="userMenu">
		        <div class="menuWrapper">
			        <ul>
				        <li id="loginLink">
					        @Html.JavaScriptLink("Вход", "toggleLogOnForm();")
				        </li>
				        <li id="regLink">
					        @Html.JavaScriptLink("Регистрация", "toggleRegistrationForm();")
				        </li>
				        <li id="learnLink" class="listItemWoSep">
					        @Html.JavaScriptLink("Обучение по работе с сайтом", "toggleTutorialBlock();")
				        </li>
			        </ul>
		        </div>
	        </div>
            <div id="registrationContentHolder" class="menuWrapper"></div>
        }

        <div id="mainMenu">
	        <div class="menuWrapper">
		        <ul class="justify">
			        @Html.MenuItem("GIGA проекты", "Index", "GigaProjects", "leftMenuItem",area: "")
			        @Html.MenuItem("Товары", "Index", "Goods", "menuItem", "goods", area: "Catalog")
			        @Html.MenuItem("Магазины", "Index", "Shops", "menuItem", "shops", area: "Catalog")
			        @Html.MenuItem("Услуги", "Index", "Services", "menuItem", "services", area: "Catalog")
			        @Html.MenuItem("Работа", "Index", "Jobs", "menuItem", "jobs", area: "Catalog")
			        @Html.MenuItem("Визитница", "Index", "Cards", "menuItem", "cards", area: "Catalog")
			        @Html.MenuItem("Каталог сайтов", "Index", "Sites", "menuItem", "sites", area: "Catalog")
			        @Html.MenuItem("Объявления", "Index", "Ads", "menuItem", "ads", area: "Catalog")
			        @Html.MenuItem("Развлечения", "Index", "Entertainment", "rightMenuItem")
		        </ul>
	        </div>
        </div>

        <div id="content">
            @RenderBody()
        </div>

        <div id="bottomMenu">
            <div id="socialNets"></div>
            <ul>
                <li id="rules">
                    @Html.ActionLink("Правила", "Rules", "Home")
                </li>
                <li id="sitemap">
                    @Html.ActionLink("Карта сайта", "Map", "Home")
                </li>
                <li id="contacts">
                    @Html.ActionLink("Контакты", "Contacts", "Home")
                </li>
                <li id="advertising" class="noBd">
                    @Html.ActionLink("Реклама", "Adv", "Home")
                </li>
            </ul>
        </div>

        <div id="gigaButton"></div>
    </div>
    
    <script type="text/javascript">
        (function () {
            if ($.browser.msie && $.browser.version === '8.0') {
                $('#mainMenu ul li').css('cssText', '');
            }
        })();
    </script>
    
    @* Гугл аналитика *@
    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-30167689-1']);
        _gaq.push(['_trackPageview']);

        (function () {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();

    </script>
</body>
</html>
